<!DOCTYPE html>
<html>
<head>
    <title>百易课堂</title>
    <#include "/header.html">
    <link type="text/css" rel="stylesheet" href="${request.contextPath}/statics/plugins/layui/css/layui.css">
    <script type="text/javascript" charset="utf-8"
            src="${request.contextPath}/statics/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${request.contextPath}/statics/ueditor/ueditor.all.min.js"></script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8"
            src="${request.contextPath}/statics/ueditor/lang/zh-cn/zh-cn.js"></script>
    <style>
        th {
            text-align: center;
        }

        .form-control {
            margin-left: 10px;
        }

    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline">
                <div class="form-group">
                    <select v-model="q.type" class="form-control">
                        <option v-for="type in this.types" :value="type.type">{{type.name}}</option>
                    </select>
                    <select v-model="q.state" class="form-control">
                        <option v-for="isShow in this.states" :value="isShow.value">{{isShow.msg}}</option>
                    </select>
                    <input type="button" class="btn btn-default form-control" @click="query" value="查询"/>
                    <input type="button" class="btn btn-primary form-control" @click="clean" value="刷新"/>
                    <input type="button" class="btn btn-default form-control" @click="update" value="修改"/>
                    <input type="button" class="btn btn-default form-control" @click="add" value="新增"/>


                </div>
            </form>
            <!--<#if shiro.hasPermission("sys:agent:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>-->
            <!--<#if shiro.hasPermission("sys:agent:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("sys:user:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>-->
        </div>

        <table id="jqGrid"></table>

        <div id="jqGridPager"></div>
    </div>


    <div v-show="showUpdate" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal updateBanner" enctype="multipart/form-data">
            <input type="hidden" class="form-control" name="goodsBannerId" v-model="banner.bannerId"
                   readonly="readonly"/>
            <div class="form-group">
                <div class="col-sm-2 control-label">封面图片</div>
                <div class="col-sm-10">
                    <input type="file" class="form-control" name="file" id="bannerImg"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">标题</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="title" v-model="banner.title"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">顺序</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="sort" v-model="banner.sort"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">类型</div>
                <div class="col-sm-10">
                    <select v-model="banner.type" class="form-control" name="type">
                        <option v-for="type in this.types" :value="type.type">{{type.name}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">状态</div>
                <div class="col-sm-10">
                    <select class="form-control" name="state" v-model="banner.state">
                        <option v-for="state in this.states" :value="state.value">{{state.msg}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">内容</div>
                <div class="col-sm-10">
                    <div id="editor" type="text/plain" style="width:800px;height:300px;" >

                    </div>

                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary " @click="modify" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>;
    <script src="${request.contextPath}/statics/js/modules/appIndex/lessionList.js?_${.now?long}"></script>
    <script src="${request.contextPath}/statics/plugins/layui/layui.js"></script>
    <script>

        layui.use('laydate', function () {
            var laydate = layui.laydate;

            //常规用法
            var startDate = laydate.render({
                elem: '#startDate',
                format: 'yyyy-MM-dd',
                done: function (value, date) {
                    if (value != '') {
                        date.month = date.month - 1;
                        endDate.config.min = date;
                        endDate.value = value;
                        $("#endDate").val(endDate.value);
                    }
                }
            });
            var endDate = laydate.render({
                elem: '#endDate',
                format: 'yyyy-MM-dd',
                done: function (value, date) {
                    if (value != '') {
                        date.month = date.month - 1;
                        startDate.config.max = date;
                    }
                }
            });
        });

    </script>

</body>
<img src="" width="720px" height="auto" style="display: none;" id="goodsImg">
<div id="content" style="display: none;width: 375px;height: 667px">

</div>
</html>